{include file="header.tpl"}

		{if $show_preview}
			{include file="edit-post-preview.tpl"}
		{/if}
		
		<div id="content">
			<div id="job-listings"></div><!-- #job-listings -->
			<br />
			{if $filter_error}
			<div class="validation-failure">
				<img src="{$BASE_URL}img/icon-delete.png" alt="" />
				{$filter_error}
			</div>
			{/if}
			{if $errors}
			<div class="validation-failure">
				<img src="{$BASE_URL}img/icon-delete.png" alt="" />
				{$translations.publish.form_error}
			</div>
			{/if}

			<form id="publish_form" method="post" action="{$BASE_URL_ADMIN}edit-post/{$job.id}/">
				<fieldset>
					<legend>Edit job</legend>
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					<table border="0" cellspacing="2" cellpadding="2">
						<tr>
							<td>
								&nbsp;&nbsp;<span class="publish-label">{$translations.publish.type_label}</span>:</td>
						    <td>&nbsp;<select name="category_id" id="category_id" tabindex="1">
									{section name=tmp1 loop=$categories}
									<option value="{$categories[tmp1].id}" {if $default_categ_id != '' && $default_categ_id == $categories[tmp1].id}selected="selected"{else}{if $categories[tmp1].id == $job.category_id}selected="selected"{/if}{if $categories[tmp1].id == $smarty.post.category_id}selected="selected"{/if}{/if}>{$categories[tmp1].name}</option>
									{/section}
								</select></td>
						</tr>
						<tr>
							<td class="publish-label" valign="top">{$translations.publish.title_label}:</td>
							<td>
								<input {if $errors.title}class="error"{/if} type="text" name="title" id="title" tabindex="2" size="50" value="{if $job.company}{$job.title}{else}{$smarty.post.title}{/if}" />
								{if $errors.title}<span class="validation-error"><img src="{$BASE_URL}img/icon-delete.png" alt="" /></span>{/if}
								<div class="{$translations.publish.title_info}"></div>							</td>
						</tr>
						<tr>
							<td valign="top">{$translations.publish.location_label}:</td>
							<td>
							
							
							{literal}
							<script type="text/javascript">
							{/literal}
	{section name="c" loop=$mycities}
	var _City_{$mycities[c].stateid} = [{$mycities[c].statestring}];
	{/section}					
	
		
//var _City_1 = ["100201:\u5bc6\u4e91\u53bf", "100202:\u5ef6\u5e86\u53bf"];
// _City_2 = ["200101:\u9ec4\u6d66\u533a", "200102:\u5362\u6e7e\u533a"];
//  _City_3 = ["300104:\u5357\u5f00\u533a", "300101:\u548c\u5e73\u533a"];
//   _City_4 = ["400101:\u4e07\u5dde\u533a", "400102:\u6daa\u9675\u533a"];
//    _City_5 = ["150001:\u54c8\u5c14\u6ee8\u5e02", "150002:\u7ee5\u5316\u5e02"];
//     _City_6 = ["130001:\u957f\u6625\u5e02", "130002:\u5409\u6797\u5e02"];
//      _City_7 = ["110001:\u6c88\u9633\u5e02", "110002:\u5927\u8fde\u5e02"];
//       _City_8 = ["250001:\u6d4e\u5357\u5e02", "250002:\u9752\u5c9b\u5e02"]; 
       
       {literal}
       function myx($) { return typeof ($) == "string" ? document.getElementById($) : $ } 
       var type_idCityComponent = new Object(), comtype_idElementId = 0, comCityElementId = 0; type_idCityComponent.init = function(C, I) { comtype_idElementId = C; comCityElementId = I; var B = ["NSW", "QLD", "NT", "WA", "SA", "VIC", "TAS","ACT"], _ = myx(comtype_idElementId), D = _.selectedIndex, A = _.options, E = A.length; if (D >= 0) { try { for (var H = E; H > 1; H--) _.remove(H - 1); E = A.length; for (H = 0; H < B.length; H++) { var G = document.createElement("OPTION"); _.options.add(G); G.value = H + 1; G.text = B[H].toString() } } catch (F) { alert("[init]" + F.message) } } window.attachEvent ? myx(C).attachEvent("onchange", type_idCityComponent.CreateCityList) : myx(C).addEventListener("change", type_idCityComponent.CreateCityList, false) }; type_idCityComponent.CreateCityList = function(e) { var type_idSelectedIndex = myx(comtype_idElementId).selectedIndex; if (type_idSelectedIndex >= 1 && type_idSelectedIndex <= 31) { try { var cityArr = eval("_City_" + type_idSelectedIndex), cityArrLen = cityArr.length, oCitySelect = myx(comCityElementId), oColl = oCitySelect.options, oCollLen = oColl.length; for (var i = oCollLen; i > 1; i--) oCitySelect.remove(i - 1); oCollLen = oColl.length; var subArr = []; for (var j = 0; j < cityArrLen; j++) { var oOption = document.createElement("OPTION"); oCitySelect.options.add(oOption); subArr = cityArr[j].split(":"); oOption.value = subArr[0].toString(); oOption.text = subArr[1].toString() } } catch (e) { alert("[CityList]" + e.message) } } else if (type_idSelectedIndex > 0) { try { cityArr = eval("_City_" + type_idSelectedIndex), cityArrLen = cityArr.length, oCitySelect = myx(comCityElementId), oColl = oCitySelect.options, oCollLen = oColl.length; for (i = oCollLen; i > 1; i--) oCitySelect.remove(i - 1); oCollLen = oColl.length; subArr = []; for (j = 0; j < cityArrLen; j++) { oOption = document.createElement("OPTION"); oCitySelect.options.add(oOption); subArr = cityArr[j].split(":"); oOption.value = subArr[0].toString(); oOption.text = subArr[1].toString() } } catch (e) { alert("[CityList]" + e.message) } } }
    </script>
    {/literal}
    
							
							State:<select id="type_id" name="type_id"><option value="0">State</option></select>&nbsp;&nbsp;
   Area:
   <select id="city" name="city">
   <option value="0">Area</option>
   
   
   {section name="c" loop=$allcities}
	<option value="{$allcities[c].id}" {if $job.city==$allcities[c].id}selected{/if}>{$allcities[c].name}</option>
	{/section}	
   
   </select>
   
   {literal}
   <script type="text/javascript">
    //<![CDATA[
    type_idCityComponent.init("type_id", "city");
    //]]>
</script>
{/literal}
							
							
							
							
							
							
							
							
<!--
								<select name="city_id" id="city_id" tabindex="3" {if $job.location_outside_ro != '' OR $smarty.post.location_outside_ro_where != ''}disabled="disabled"{/if}>
									{section name="c" loop=$cities}
									<option value="{$cities[c].id}" {if $smarty.post.city_id == $cities[c].id || $job.city_id == $cities[c].id}selected="selected"{else}{if $user_city.id == $cities[c].id AND !$smarty.post.city_id AND !$job.city_id}selected="selected"{/if}{/if}>{if $cities[c].id == -1}-- {$cities[c].name} --{else}{$cities[c].name}{/if}</option>
									{/section}
								</select>
								
							
								<a id="other_location_label" href="#" onclick="Jobber.HandleLocationOutsideRo(); return false;">{if $job.location_outside_ro != '' OR $smarty.post.location_outside_ro_where != ''}{$translations.publish.country}{else}{$translations.publish.other}{/if}</a>
								-->	<div id="location_outside_ro" {if $job.location_outside_ro != '' OR $smarty.post.location_outside_ro_where != ''}style="display: block;"{else}style="display: none;"{/if}>
									{$translations.publish.where} <input type="text" name="location_outside_ro_where" id="location_outside_ro_where" size="50" maxlength="140" {if $job.location_outside_ro != ''}value="{$job.location}"{/if}{if $smarty.post.location_outside_ro_where != ''}value="{$smarty.post.location_outside_ro_where}"{/if} />
									<div class="suggestion">{$translations.publish.where_info}</div>
								</div>
							</td>
						</tr>
						
						

						

												<tr>
							<td class="publish-label" valign="top">{$translations.property.suburb}:</td>
							<td>	
								<input {if $errors.suburb}class="error"{/if} type="text" name="suburb" id="suburb" tabindex="2" size="50" value="{if $job.company}{$job.suburb}{else}{$smarty.post.suburb}{/if}" />
								{if $errors.price}<span class="validation-error"><img src="{$BASE_URL}img/icon-delete.png" alt="" /></span>{/if}
								<div class="{$translations.publish.suburb_info}"></div>							</td>
						</tr>

						
						
						<tr>
							<td valign="top">{$translations.publish.description_label}:</td>
							<td><textarea {if $errors.description}class="error"{/if} tabindex="4" name="description" id="description" cols="80" rows="15">{if $job.company}{$job.description}{else}{$smarty.post.description}{/if}</textarea>
								{if $errors.description}<span class="validation-error"><img src="{$BASE_URL}img/icon-delete.png" alt="" /></span>{/if}
								<div class="suggestion">
									<a target="_blank" href="http://www.textism.com/tools/textile/" onclick="$('#textile-suggestions').toggle(); return false;">{$translations.publish.description_info}</a></div>
								<div id="textile-suggestions" style="display: none;">
									<table>
											<thead>
											<tr class="odd">
												<th>{$translations.publish.syntax}</th>
												<th>{$translations.publish.result}</th>
											</tr>
											</thead>
											<tbody>
											<tr class="even">
												<td>That is _incredible_</td>
												<td>That is <em>incredible</em></td>
											</tr>
											<tr class="odd">
												<td>*Indeed* it is</td>
												<td><strong>Indeed</strong> it is</td>
											</tr>
											<tr class="even">
												<td>"Wikipedia":http://www.wikipedia.org</td>

												<td><a href="http://www.wikipedia.org">Wikipedia</a></td>
											</tr>
											<tr class="odd">
												<td>* apples<br />* oranges<br />* pears</td>
												<td>

													<ul>
														<li>apples</li>
														<li>oranges</li>
														<li>pears</li>
													</ul>												</td>
											</tr>

											<tr class="even">
												<td># first<br /># second<br /># third</td>
												<td>
													<ol>
														<li>first</li>
														<li>second</li>

														<li>third</li>
													</ol>												</td>
											</tr>
											</tbody>
										</table>
								</div><!-- #textile-suggestions -->							</td>
						</tr>
						
						
						<tr>
						  <td class="publish-label">Simpfied Chinese</td>
						  <td><textarea {if $errors.description_zh}class="error"{/if} tabindex="4" name="description_zh" id="description_zh" cols="80" rows="15">{if $job.company}{$job.description_zh}{else}{$smarty.post.description_zh}{/if}</textarea></td>
					  </tr>
						<tr>
						  <td class="publish-label">Traditional Chinese</td>
						  <td><textarea {if $errors.description_tw}class="error"{/if} tabindex="4" name="description_tw" id="description_tw" cols="80" rows="15">{if $job.company}{$job.description_tw}{else}{$smarty.post.description_tw}{/if}</textarea></td>
					  </tr>
						<tr>
						  <td class="publish-label">{$translations.publish.photo}</td>
						  <td><button id="uploadbutton"/>Upload</button> You can include up to 27 images (photos and floorplans) within your ad</td>
					  </tr>
						<tr>
						  <td class="publish-label"><strong>Uploaded:</strong><input type='hidden' name="times" value="1" id="times"></td>
						  <td class="uploadfiles">						  </td>
					  </tr>
					  <!--
						<tr>
							<td class="publish-label">{$translations.publish.photo}
							 :</td>
							<td>
							<input type="file" name="photo" />
							<span class="validation-error">{if $errors.poster_photo}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.photo_info2}								</div>							</td>
						</tr>
						-->
						
						<tr>
							<td class="publish-label">{$translations.property.bedrooms}
							 :</td>
							<td><span class="validation-error">
							  <select name="bedrooms" id="ctl00_SearchMoreCriteria1_ddlBedrooms" class="sInput">
              <option value="0" {if $job.bedrooms==0}selected{/if}>0</option>
              <option value="1" {if $job.bedrooms==1}selected{/if}>1</option>
              <option value="2" {if $job.bedrooms==2}selected{/if}>2</option>
              <option value="3" {if $job.bedrooms==3}selected{/if}>3</option>
              <option value="4" {if $job.bedrooms==4}selected{/if}>4</option>
              <option value="5">5</option>
          </select>
							  

							  
						    {if $errors.bedrooms}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.bedrooms2}								</div>						  </td>
						</tr>
						
												<tr>
							<td class="publish-label">{$translations.property.bathrooms}
							 :</td>
							<td><span class="validation-error">
							  <select name="bathrooms" id="ctl00_SearchMoreCriteria1_ddlBathrooms" class="sInput">
              <option value="0" {if $job.bathrooms==0}selected{/if}>0</option>
              <option value="1" {if $job.bathrooms==1}selected{/if}>1</option>
              <option value="2" {if $job.bathrooms==2}selected{/if}>2</option>
              <option value="3" {if $job.bathrooms==3}selected{/if}>3</option>
              <option value="4" {if $job.bathrooms==4}selected{/if}>4</option>
              <option value="5" {if $job.bathrooms==5}selected{/if}>5</option>
          </select>
						    {if $errors.bathrooms}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.bathrooms2}								</div>						  </td>
						</tr>
						
												<tr>
							<td class="publish-label">{$translations.property.carspaces}
							 :</td>
							<td><span class="validation-error">
							  <select name="carspaces" id="ctl00_SearchMoreCriteria1_ddlCarSpaces" class="sInput">
              <option value="0"  {if $job.carspaces==0}selected{/if}>0</option>
              <option value="1" {if $job.carspaces==1}selected{/if}>1</option>
              <option value="2" {if $job.carspaces==2}selected{/if}>2</option>
              <option value="3" {if $job.carspaces==3}selected{/if}>3</option>
              <option value="4" {if $job.carspaces==4}selected{/if}>4</option>
              <option value="5" {if $job.carspaces==5}selected{/if}>5</option>
          </select>
						    {if $errors.carspaces}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.carspaces2}								</div>						  </td>
						</tr>
												<tr>
							<td class="publish-label">{$translations.property.propertytype}
							 :</td>
							<td><span class="validation-error">
							  <select name="propertytype" id="ctl00_SearchMoreCriteria1_ddlPropType" class="sInput">
              <option value="">Property Type</option>
			  
			  {section name=tmp1 loop=$property_array}
									<option value="{$property_array[tmp1].id}" {if $default_categ_id != '' && $default_categ_id == $property_array[tmp1].id}selected="selected"{else}{if $property_array[tmp1].id == $job.propertytype}selected="selected"{/if}{if $property_array[tmp1].id == $smarty.post.category_id}selected="selected"{/if}{/if}>{$property_array[tmp1].name}</option>
									{/section}
			  
          </select>
						    {if $errors.propertytype}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.propertytype2}								</div>						  </td>
						</tr>
<tr>
							<td class="publish-label" valign="top">{$translations.property.price}:</td>
							<td>	
								$&nbsp;<input {if $errors.price}class="error"{/if} type="text" name="price" id="price" tabindex="2" size="12" value="{if $job.company}{$job.price}{else}{$smarty.post.price}{/if}" />
								{if $errors.price}<span class="validation-error"><img src="{$BASE_URL}img/icon-delete.png" alt="" /></span>{/if}
								<div class="{$translations.publish.price_info}"></div>							</td>
					  </tr>
					</table>
					
					
					
					
					
				</fieldset>
				
				
				<!--
				<fieldset>
					<legend>{$translations.publish.company}</legend>
					<table border="0" cellspacing="2" cellpadding="2">
						<tr>
							<td class="publish-label">{$translations.publish.name_label}:</td>
							<td><input {if $errors.company}class="error"{/if} tabindex="6" type="text" name="company" id="company" size="40" value="{if $job.company}{$job.company}{else}{$smarty.post.company}{/if}" />
							<span class="validation-error">{if $errors.company}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
							</td>
						</tr> 
						<tr>
							<td valign="top">{$translations.publish.website_label}:</td>
							<td>http://<input tabindex="7" type="text" name="url" id="url" size="35" value="{if $job.company}{$job.url}{else}{$smarty.post.url}{/if}" />
								<div class="suggestion">{$translations.publish.website_info}</div>
							</td>
						</tr>
						<tr>
							<td class="publish-label">{$translations.publish.email_label}<br /><strong>({$translations.publish.email_info1})</strong>:</td>
							<td>
								<input {if $errors.poster_email}class="error"{/if} tabindex="8" type="text" name="poster_email" id="poster_email" size="40" value="{if $job.poster_email}{$job.poster_email}{else}{$smarty.post.poster_email}{/if}" />
								<span class="validation-error">{if $errors.poster_email}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.email_info2}
								</div>
							</td>
						</tr>
					</table>
				</fieldset>
				-->
				
				
				<fieldset>
					<legend>{$translations.publish.company}</legend>
					<table border="0" cellspacing="2" cellpadding="2">
						
						{if $seller_type==1}
						<tr>
							<td class="publish-label">{$translations.property.company}:</td>
							<td><input {if $errors.company}class="error"{/if} tabindex="6" type="text" name="company" id="company" size="40" value="{if $job.company}{$job.company}{else}{$smarty.post.company}{/if}" />
							<span class="validation-error">{if $errors.company}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>							</td>
						</tr> 
						{else}
						<input type="hidden" name="company" value="none" />
						{/if}
						
						
						<!--
						<tr>
							<td valign="top">{$translations.publish.website_label}:</td>
							<td>http://<input tabindex="7" type="text" name="url" id="url" size="35" value="{if $job.company}{$job.url}{else}{$smarty.post.url}{/if}" />
								<div class="suggestion">{$translations.publish.website_info}</div>
							</td>
						</tr>
						-->
						<tr>
                          <td class="publish-label">{$translations.property.contactman}:</td>
						  <td><input {if $errors.contact}class="error"{/if} tabindex="6" type="text" name="contact" id="contact" size="40" value="{if $job.contact}{$job.contact}{else}{$smarty.post.contact}{/if}" />
                              <span class="validation-error">{if $errors.company}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span> </td>
					  </tr>
						<tr>
						  <td class="publish-label">{$translations.property.email}<br /></td>
							<td>
								<input {if $errors.poster_email}class="error"{/if} tabindex="8" type="text" name="poster_email" id="poster_email" size="40" value="{if $job.poster_email}{$job.poster_email}{else}{$smarty.post.poster_email}{/if}" />
								<span class="validation-error">{if $errors.poster_email}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>							</td>
						</tr>
						
						<tr>
						  <td class="publish-label">{$translations.property.phone}<br /></td>
							<td>
								<input {if $errors.poster_phone}class="error"{/if} tabindex="8" type="text" name="poster_phone" id="poster_phone" size="40" value="{if $job.phone}{$job.phone}{else}{$smarty.post.phone}{/if}" />
								<span class="validation-error">{if $errors.poster_phone}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<!--
								<div class="suggestion">
									{$translations.publish.phone_info2}
								</div>
								-->							</td>
						</tr>
						
						<tr>
							<td class="publish-label">{$translations.publish.inspectiontimes_label}:</td>
							<td>
								<input {if $errors.poster_inspectiontimes}class="error"{/if} tabindex="8" type="text" name="inspectiontimes" id="inspectiontimes" size="40" value="{if $job.inspectiontimes}{$job.inspectiontimes}{else}{$smarty.post.inspectiontimes}{/if}" />
								<span class="validation-error">{if $errors.inspectiontimes}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
								<div class="suggestion">
									{$translations.publish.inspectiontimes_info2}								</div>							</td>
						</tr>
					</table>
				</fieldset>
			
				<fieldset>
					<input type="button" id="save" value="Save" />
					<input type="button" id="preview" value="Preview" />
				</fieldset>
				<fieldset class="hidden">
					<input type="checkbox" name="apply_online" id="apply_online" checked="checked" />
					<input type="hidden" name="show_preview" id="show_preview" value="false" />
					<input type="hidden" name="job_id" value="{$job.id}" />
				</fieldset>
			</form>
		</div><!-- /content -->
		
		{literal}
		<script type="text/javascript">
			$(document).ready(function()
			{
				$('#title').focus();
				
				if (BrowserDetect.browser != "Explorer")
				{
					$("#publish_form").validate({
						rules: {
							company: { required: true },
							title: { required: true },
							description: { required: true },
							poster_email: { required: true }
						},
						messages: {
							company: ' <img src="{/literal}{$BASE_URL}{literal}img/icon-delete.png" alt="" />',
							title: ' <img src="{/literal}{$BASE_URL}{literal}img/icon-delete.png" alt="" />',
							location: ' <img src="{/literal}{$BASE_URL}{literal}img/icon-delete.png" alt="" />',
							description: ' <img src="{/literal}{$BASE_URL}{literal}img/icon-delete.png" alt="" />',
							poster_email: ' <img src="{/literal}{$BASE_URL}{literal}img/icon-delete.png" alt="" />'
						}
					});	
				}
				
				$('#save').bind('click', function()
				{
					$("#publish_form").submit();
				});
				
				$('#preview').bind('click', function()
				{
					$('#show_preview').val('true');
					$("#publish_form").submit();
				});
			});
		</script>
		{/literal}

{include file="footer.tpl"}